/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package de.blitzcoder.collide.gui;

import de.blitzcoder.collide.icons.Icon;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.Window;
import javax.swing.JDialog;

/**
 *
 * @author blitzcoder
 */
public class IDEDialog extends JDialog {

    public IDEDialog(Window owner) {
        this(owner,"");
    }
    
    public IDEDialog(Window owner,String title) {
        super(owner);
        setTitle(title);
        setIconImage(Icon.load("icon.png").getImage());
    }
    
    @Override
    public void setTitle(String title) {
        super.setTitle("CollIDE | "+title);
    }
    
    @Override
    public void setVisible(boolean v) {
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
        int width = getWidth();
        int height = getHeight();
        setLocation( screenSize.width/2-width/2 , screenSize.height/2-height/2 ); 
        super.setVisible(v);
    }
    
}
